<template>
  <el-container>
    <!-- 定义侧边栏导航 -->
    <el-aside width="260px">
      <!-- 定义导航菜单 -->
      <!--default-active="1"  默认的展开项目 -->
      <!-- @open="handleOpen"
        @close="handleClose"
        打开、关闭是调用的事件处理函数
        router : 使用        vue-router        的模式，启用该模式会在激活导航时以        index        作为        path
        进行路由跳转
       -->
      <el-menu default-active="1" class="el-menu-vertical-demo" @open="handleOpen" @close="handleClose" router>
        <!--el-submenu 导航菜单的分支节点  -->
        <el-submenu index="1">
          <template slot="title">
            <i class="el-icon-document-add"></i>
            <span>挂号&收费</span>
          </template>
          <!-- el-menu-item ：叶子节点 -->
          <el-menu-item index="/guahao/ghview">窗口挂号</el-menu-item>
          <el-menu-item index="/guahao/thview">窗口退号</el-menu-item>
          <el-menu-item index="1-3">收费</el-menu-item>
          <el-menu-item index="1-4-1">退费</el-menu-item>
        </el-submenu>
      </el-menu>
    </el-aside>
    <el-main><router-view></router-view></el-main>
  </el-container>
</template>

<script>
export default {
  name: 'GuaHao',
  methods: {
    handleOpen(key, keyPath) {
      console.log(key, keyPath)
    },
    handleClose(key, keyPath) {
      console.log(key, keyPath)
    }
  }
}
</script>

<style scoped lang="less">
.el-aside {
  background-color: #d3dce6;
  color: #333;
}

.el-main {
  background-color: #e9eef3;
  color: #333;
}
</style>
